import React, { Component } from 'react'
import {Route,Redirect,NavLink,Switch} from "react-router-dom"
import RouterView from '../router/routerView'
import My from './my'
import Detail from "./detail"
import All from "./all"
import routerList from '../router/routerList'

// Route标签就相当于vue 的 routerview
// Redirect 是重定向的意思
// NavLink 相当于vue 得 router-link
 class App extends Component {
  render() {
    return (
      <>
       <RouterView RouterList={routerList}></RouterView>
          {/* Switch标签是为了保证路由得精准性和唯一性得 */}
          {/* <Switch>
           
               <Route path="/all" component={All} child={}></Route>
               <Route path="/my" component={My}></Route>
                <Route path="/detail" component={Detail}></Route>
               <Redirect to="/all" from="/"></Redirect>
              
          </Switch> */}
          {/* 可以把它理解为vue得routerlink */}
        
          
      </>
    )
  }
}

export default App